<tmpl:/item/tinymce_setup />
            <g:form method="post" mapping="generic" controller="item" action="${editFormAction}" id="${itemInstance?.id}">
                <div class="dialog">
                    <g:hiddenField name="version" value="${itemInstance?.version}" />
                    <div>
                        <span class="element-label">
                            <label for="type"><g:message code="item.type.label" default="Type" />:</label>
                        </span>
                        <span class="element-value ${hasErrors(bean: itemInstance, field: 'type', 'errors')}">
                            <g:lookupSelect id="type" name="type" realm="item.type" value="${itemInstance?.type}" />
                        </span>
                    </div>
                    <div class="clear"></div>

                    <div>
                        <span class="element-label">
                            <label for="title"><g:message code="item.title.label" default="Title" />:</label>
                        </span>
                        <span class="element-value ${hasErrors(bean: itemInstance, field: 'title', 'errors')}">
                            <g:textField name="title" value="${itemInstance?.title}" size="65"/>
                        </span>
                    </div>
                    <div class="clear"></div>

                    <div>
                        <span class="element-label">
                            <label for="published_date"><g:message code="item.published.label" default="Published" />:</label>
                        </span>
                        <span class="element-value ${hasErrors(bean: itemInstance, field: 'published', 'errors')}">
                            <input id="published_date" type="text" name="published" value="${publishedDate}" size="25" />
                        </span>
                    </div>
                    <div class="clear"></div>

                    <div>
                        <span class="element-label element-label-shift">
                            <label for="description"><g:message code="item.description.label" default="Description" />:</label>
                        </span>
                        <span class="element-value ${hasErrors(bean: itemInstance, field: 'description', 'errors')}">
                            <g:textArea id="description" name="description" value="${itemInstance?.description}" rows="10" cols="80"/>
                        </span>
                    </div>
                    <div class="clear"></div>

                    <div>
                        <span class="element-label">
                            <label for="language"><g:message code="item.language.label" default="Language" />:</label>
                        </span>
                        <span class="element-value ${hasErrors(bean: itemInstance, field: 'language', 'errors')}">
                            <g:lookupSelect id="language" name="language" realm="language" value="${itemInstance?.language ? itemInstance.language : 'eng'}" />
                        </span>
                    </div>
                    <div class="clear"></div>

                    <div>
                        <span class="element-label">
                            <label for="license"><g:message code="item.license.label" default="License" />:</label>
                        </span>
                        <span class="element-value ${hasErrors(bean: itemInstance, field: 'license', 'errors')}">
                            <g:lookupSelect id="license" name="license" realm="item.license" value="${itemInstance?.license}" />
                        </span>
                    </div>
                    <div class="clear"></div>

                    <div>
                        <span class="element-label">
                            <label for="collection"><g:message code="item.collection.label" default="Collection" />:</label>
                        </span>
                        <span class="element-value ${hasErrors(bean: itemInstance, field: 'collection', 'errors')}">
                            <g:select id="collection" name="collection" from="${collectionList}"
                                        value="${itemInstance?.collection?.id}" optionKey="id" optionValue="name" />
                        </span>
                    </div>
                    <div class="clear"></div>
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="save" value="${message(code: 'default.button.update.label')}" /></span>
                </div>
            </g:form>